﻿using System;
using System.ComponentModel;
using Loki;
using Loki.UI;
using Luna.Model;

namespace Luna.UI.Accounting
{
    public class DisplayableOperation : Displayable<LunaModel>
    {
        #region  ID
        private static PropertyChangedEventArgs _IDChangeArgs = ObservableHelper.CreateArgs<DisplayableOperation>(x => x.ID);

        private Guid _ID;

        public Guid ID
        {
            get
            {
                return _ID;
            }

            set
            {
                if (value != _ID)
                {
                    _ID = value;
                    NotifyChangedAndDirty(_IDChangeArgs);
                }
            }
        }
        #endregion

        #region  Description
        private static PropertyChangedEventArgs _DescrtiptionChangeArgs = ObservableHelper.CreateArgs<DisplayableOperation>(x => x.Description);

        private string _Description;

        public string Description
        {
            get
            {
                return _Description;
            }

            set
            {
                if (value != _Description)
                {
                    _Description = value;
                    NotifyChangedAndDirty(_DescrtiptionChangeArgs);
                }
            }
        }
        #endregion

        #region  CategoryID
        private static PropertyChangedEventArgs _CategoryIDChangeArgs = ObservableHelper.CreateArgs<DisplayableOperation>(x => x.CategoryID);

        private Guid? _CategoryID;

        public Guid? CategoryID
        {
            get
            {
                return _CategoryID;
            }

            set
            {
                if (value != _CategoryID)
                {
                    _CategoryID = value;
                    NotifyChangedAndDirty(_CategoryIDChangeArgs);
                }
            }
        }
        #endregion

        #region  ProjectID
        private static PropertyChangedEventArgs _ProjectIDChangeArgs = ObservableHelper.CreateArgs<DisplayableOperation>(x => x.ProjectID);

        private Guid? _ProjectID;

        public Guid? ProjectID
        {
            get
            {
                return _ProjectID;
            }

            set
            {
                if (value != _ProjectID)
                {
                    _ProjectID = value;
                    NotifyChangedAndDirty(_ProjectIDChangeArgs);
                }
            }
        }
        #endregion

        #region  Amount
        private static PropertyChangedEventArgs _AmountChangeArgs = ObservableHelper.CreateArgs<DisplayableOperation>(x => x.Amount);

        private decimal _Amount;

        public decimal Amount
        {
            get
            {
                return _Amount;
            }

            set
            {
                if (value != _Amount)
                {
                    _Amount = value;
                    NotifyChangedAndDirty(_AmountChangeArgs);
                }
            }
        }
        #endregion

        #region  Date
        private static PropertyChangedEventArgs _DateChangeArgs = ObservableHelper.CreateArgs<DisplayableOperation>(x => x.Date);

        private DateTime _Date;

        public DateTime Date
        {
            get
            {
                return _Date;
            }

            set
            {
                if (value != _Date)
                {
                    _Date = value;
                    NotifyChangedAndDirty(_DateChangeArgs);
                }
            }
        }
        #endregion

        #region  ValueDate
        private static PropertyChangedEventArgs _ValueDateChangeArgs = ObservableHelper.CreateArgs<DisplayableOperation>(x => x.ValueDate);

        private DateTime? _ValueDate;

        public DateTime? ValueDate
        {
            get
            {
                return _ValueDate;
            }

            set
            {
                if (value != _ValueDate)
                {
                    _ValueDate = value;
                    NotifyChangedAndDirty(_ValueDateChangeArgs);
                }
            }
        }
        #endregion

        public DisplayableOperation()
        {
            Date = DateTime.Today;
        }
    }
}
